<style lang="less" scoped>
  @import "../assets/css/all.less";
  @import '~vux/src/styles/center.less';

</style>
<template>
  <div class="all-content">
    <div class="shop">
      <div class="item-shop" :class="{'item-last':detail.length%2!==0&&key===detail.length-1}" v-for="(item, key) in detail">
        <div class="img-contain">
          <img src="../assets/images/avatar.jpg" :src="item.imgSrc" alt="">
        </div>
        <div class="title" style="-webkit-box-orient: vertical;">{{item.title}}</div>
        <div class="price">
          <span class="fz-16 color-E52C2C fw">￥{{item.price}}</span>
          <span class="fz-12 color-999 original-price">￥{{item.originalPrice}}</span>
        </div>
      </div>
      <div class="clear"></div>
    </div>
  </div>
</template>
<script>
  import common from '../js/common'
  export default {
    name: 'all',
    components: {

    },
    data () {
      return {
        isAndroid: true,
        detail: [
          {
            imgSrc: require('../assets/images/avatar.jpg'),
            title: '韩国2017下级新品白色两件套雪纺衫宽松高领喇叭七件套',
            price: 109,
            originalPrice: 209
          },
          {
            imgSrc: require('../assets/images/avatar.jpg'),
            title: '韩国2017下级新品白色两件套雪纺衫宽松高领喇叭七件套',
            price: 109,
            originalPrice: 209
          },
          {
            imgSrc: require('../assets/images/avatar.jpg'),
            title: '韩国2017下级新品白色两件套雪纺衫宽松高领喇叭七件套',
            price: 109,
            originalPrice: 209
          },
        ]
      }
    },
    computed: {

    },
    /**
     * 过滤器
     * 如：
     *  formatDate: function (v) {
     *      return v.replace(/T|Z/g, ' ')
     *   }
     *
     *   使用方法在页面 {{ 属性 | 过滤器名称 }}
     * */
    filters: {
      /**
       *  格式化数字，即使为0，都保留 2位小数
       * */
      formatTime(time) {
        return util.formatDate(time, 'hh:mm:ss');
      }
    },
    mounted() {


      common.methods.setTitle('全部'); // 修改顶部导航标题
      var u = navigator.userAgent;
      var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
      isAndroid ? this.isAndroid = true : this.isAndroid = false;
    },
    methods: {
      getProductList () {
        this.$store.dispatch('getShelfList', {
          shopId: util.localSearchQuery('shopId') ? util.localSearchQuery('shopId') : JSON.parse(window.localStorage.getItem('shopId'))
        }).then(function(res) {
          if(res && res.code == 0) {

          } else {
            self.productList = [];
            self.$store.commit('SHOW_TOAST', {msg: res.msg});
          }
        }, function() {
          self.$store.commit('SHOW_TOAST', {msg: '亲，服务器错误，请联系管理员', width: '250px'});
        });
      }
    },
    watch: {

    }
  }
</script>
